<style type="text/css">
		label { display:block; }
		fieldset { padding:0; border:0; margin-top:25px; }
        .fieldsetInput{ padding-top:12px; }
		h1 { font-size: 1.2em; margin: .6em 0; }
 
		.validateTips { border: 1px solid transparent; padding: 0.3em; }
		
	</style>

        <g:set var="entityName" value="${message(code: 'plan.label', default: 'Plan')}" />
        <g:form action="save" method="post" name="planSave">
                <div class="dialog">
                    
                    <table>
                        <tbody>
                            <g:hiddenField name="classesid" value="${classesid}"/>
                            <g:hiddenField name="planListCount" value="${planListCount}"/>
                            <g:hiddenField name="selectCourseTimeCount" value="${selectPlanTime}"/>
                            <div id="hiddenTeacher">

                            </div>
                            <tr class="prop">
                                <td width="30%"/>
                                <td valign="top" align="right">
                                    <select id="oselect" name="teacherCourses" style="width:200px;height:300px;" size="100" multiple>
                                    <g:each in="${teacherCourseGroup}" status="i" var="aTeacherCourseGroup">
                                       <g:if test="${aTeacherCourseGroup.key}">
                                            <OPTION course="${aTeacherCourseGroup.key}" teacher="${aTeacherCourseGroup?.value[0].teacher.id}" period="${aTeacherCourseGroup?.value.size()}" value="${aTeacherCourseGroup?.value[0].teacher.id},${aTeacherCourseGroup.key},${aTeacherCourseGroup?.value.size()}">${aTeacherCourseGroup?.value[0].teacher.name} ${aTeacherCourseGroup.key} ${aTeacherCourseGroup?.value.size()}课时 </OPTION> 
                                        </g:if>
                                    </g:each>
                                    </select>
                                     <g:hiddenField name="teacherCourses" value=""/>
                                </td>
                                <td valign="top" class="name">
                                    <input type="button" id="addTeacherCourse" value="添加"/><br><br>
                                    <input type="button" id="deleteTeacherCourse" value="删除选中"/>
                                </td>
                                <td width="33%"/>
                            </tr>
                         
                         
                        </tbody>
                    </table>
                    
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="下一步" /></span>
                </div>
                </g:form>

            <div id="dialog-form" title="选择课程和老师">
            <div id="validName" class="validateTips">
             </div>
            <form>
            <fieldset>
            <table align="center">
                <tr>
                    <td width="20%" class="fieldsetInput">
                        课程 : 
                    </td>
                    <td valign="top">
                            <g:select name="course" from="${courselst}" optionKey="code" optionValue="code"  noSelection="['':'-请选择-']"/>
                    </td>
                </tr>
                <tr>
                    <td class="fieldsetInput">
                        老师 : 
                    </td>
                    <td valign="top">
                            <select name="teacher" id="teacher" ></select>
                    </td>
                </tr>
                <tr>
                    <td class="fieldsetInput">
                        课时 : 
                    </td>
                    <td>
                            <g:select name="period" from="${['1','2','3','4','5','6','7','8']}"  />
                    </td>
                </tr>
            </table>
                  
            </fieldset>
                <g:each in="${teacherlst}" status="i" var="teacherCourseInstance">
                        <textarea style="display:none" id="${teacherCourseInstance?.key}">
                             <g:each in="${teacherCourseInstance?.value}" status="m" var="teacherInstance">
                                <option value="${teacherInstance?.id}">${teacherInstance?.name}</option>
                            </g:each>
                        </textarea>
                </g:each>
            </form>
        </div>